package priv.mill.server.impl;
import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import priv.mill.dao.mapper.QuestionMapper;
import priv.mill.entry.Question;
import priv.mill.server.QuestionService;

@Component
public class QuestionServiceImpl implements QuestionService{

	private static final Logger logger = Logger
			.getLogger(QuestionServiceImpl.class);

	@Autowired
	private QuestionMapper questionMapper;
	
	@Override
	public Question getQuestionById(Integer questionId) {
		return questionMapper.getQuestionById(questionId);
	}

	@Override
	public Question getQuestionByEntry(Question question) {
		return questionMapper.getQuestionByEntry(question);
	}

	@Override
	public List<Question> getQuestionsByPage(Question question) {
		return questionMapper.getQuestionsByPage(question);
	}

	@Override
	public int updateQuestion(Question question) {
		return questionMapper.updateQuestion(question);
	}

	@Override
	public int insertQuestion(Question question) {
		return questionMapper.insertQuestion(question);
	}

	@Override
	public int deleteQuestion(Integer questionId) {
		return questionMapper.deleteQuestion(questionId);
	}
}
